"""类型注解功能"""
# 用法一、为参数与返回数据指定类型

# def greeting(name: str) ->str:
#     return "hello" + name.split(',')[1]
# print(greeting('python_study, java'))

# 用法二、类型别名
# from typing import List
#
# Vector = List[float]
# def scale(scalar: float, vector: Vector) -> Vector:
#     return [scalar * num for num in vector]
# print(scale(1.1, [1.2, -4.2, 5.4]))

# 用法三、自定义类型
# class Student:
#     name: str
#     age: int
#     def get_money(self):
#         print("")
# def get_stu(name: str) ->Student:
#     return Student()
#
# get_stu("herry")

# 用法四、静态检查
from typing import List
a: List[int] = []
a = [1,2,'aa']
